import request from '@/config/axios'

// 终端日志 VO
export interface DeviceLogVO {
  id: number // ID
  deviceName: string // 终端名称
  logLevel: string // 日志级别
  warnTime: Date // 日志时间
  warnDesc: string // 日志内容
  warnDetail: string // 日志详情
}

// 终端日志 API
export const DeviceLogApi = {
  // 查询终端日志分页
  getDeviceLogPage: async (params: any) => {
    return await request.get({ url: `/security/device-log/page`, params })
  },

  // 查询终端日志详情
  getDeviceLog: async (id: number) => {
    return await request.get({ url: `/security/device-log/get?id=` + id })
  },

  // 新增终端日志
  createDeviceLog: async (data: DeviceLogVO) => {
    return await request.post({ url: `/security/device-log/create`, data })
  },

  // 修改终端日志
  updateDeviceLog: async (data: DeviceLogVO) => {
    return await request.put({ url: `/security/device-log/update`, data })
  },

  // 删除终端日志
  deleteDeviceLog: async (id: number) => {
    return await request.delete({ url: `/security/device-log/delete?id=` + id })
  },

  // 导出终端日志 Excel
  exportDeviceLog: async (params) => {
    return await request.download({ url: `/security/device-log/export-excel`, params })
  },
}